/*
 * @Author: your name
 * @Date: 2021-11-10 19:12:31
 * @LastEditTime: 2021-11-18 09:51:51
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\admin\src\users\index.js
 */
import request from "../../utils/request";
//登录
function login(data) {
    return request({
        url: "/login",
        method: "post",
        data: data,
    });
}
//注册
function register(data) {
    return request({
        url: "/register",
        method: "post",
        data: data,
    });
}
//修改密码
function changePassword(data) {
    return request({
        url: "/user",
        method: "put",
        data: data,
    });
}

//获取用户信息(单个)
function getUserInfo(data) {
    return request({
        url: "/user",
        method: "post",
        data: data,
    });
}
//获取用户信息(全部)
function getAllUser(data) {
    return request({
        url: "/user/all",
        method: "post",
        data: data,
    });
}
//修改用户信息
function editUserInfo(data) {
    return request({
        url: "/user/info",
        method: "put",
        data: data,
    });
}
//改变用户可用状态
function changeUserState(data) {
    return request({
        url: "/user/state",
        method: "put",
        data: data,
    });
}
//改变用户身份
function changeUseIdentity(data) {
    return request({
        url: "/user/identity",
        method: "put",
        data: data,
    });
}
//批量启用
function batchUserStart(data) {
    return request({
        url: "/user/start",
        method: "put",
        data: data,
    });
}
//批量禁用
function batchUserForbid(data) {
    return request({
        url: "/user/forbid",
        method: "put",
        data: data,
    });
}
//批量授权
function batchUserAllow(data) {
    return request({
        url: "/user/allow",
        method: "put",
        data: data,
    });
}
//批量解除授权
function batchUserRelieve(data) {
    return request({
        url: "/user/relieve",
        method: "put",
        data: data,
    });
}
export default {
    login,
    register,
    changePassword,
    getUserInfo,
    getAllUser,
    editUserInfo,
    changeUserState,
    changeUseIdentity,
    batchUserStart,
    batchUserForbid,
    batchUserAllow,
    batchUserRelieve,
};